package com.hps.poet.service.impl;


import com.hps.common.utils.BeanHelper;
import com.hps.poet.PoemDTO;
import com.hps.poet.client.PoemClient;
import com.hps.poet.po.PoemSearch;
import com.hps.poet.service.SearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SearchServiceImpl implements SearchService {

    /**
     * 调用feign接口
     */
    @Autowired
    private PoemClient poemClient;


    @Override
    public List<PoemSearch> createPoem() {
        List<PoemDTO> poemDTOList = poemClient.poemDTOList();
        return BeanHelper.copyWithCollection(poemDTOList, PoemSearch.class);
    }
}
